<template>
  <div class="home">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
    <HelloWorld msg="aaaaaaaaaaaaaaaaaaaaaaaaaa"/>
    <HelloWorld msg="bbbbbbbbbbbbbbbbbbbbbbbbbb"/>
    <HelloWorld msg="nnnnnnnnnnnnnnnnnnnnnnnnnn"/>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from "@/components/HelloWorld.vue";
import axios from "@/assets/api/axios";

export default {
  name: "home",
  mounted() {
    this.testData();
  },
  methods: {
    testData: function() {
      axios({
        url: "/test",
        method: "get"
      })
        .then(res => {
          //接收数据
          console.log(res);
        })
        .catch(err => {
          console.error(err);
        });
    }
  },
  components: {
    HelloWorld
  }
};
</script>
